% author: Markus Scherer
% generates structure element for miopen/midilate/mierode
% input:  se    ... logical matrix describing structure element
% output: struct with information about the structure element
%         x/y   ... coordinates of center
%         hu/hd ... number of pixels up and down of coordinate center
%         wl/wr ... number of pixels left and right of coordinate center
%         se    ... logical array describing structure element
function s = mistrel(se)
  s.m = logical(se);
  siz = size(se);

  tmp = ceil(siz/2);

  s.y = tmp(1);
  s.x = tmp(2);

  s.hu = 1 - tmp(1);
  s.hd = siz(1) - tmp(1);

  s.wl = 1 - tmp(2);
  s.wr = siz(2) - tmp(2);
